<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('手工导入')" />
</head>
<body class="gray-bg">
<form class="form-horizontal" id="form-handImport">
    <div class="form-group">
        <div class="col-md-12">
                <table class='table table-md table-bordered'>
                    <tr bgcolor="#C6D7EF" align="center">
                        <td align="center" colspan="4">警告</td>
                    </tr>
                    <tr align="center" bgcolor="#C6D7EF">
                        <td align="left" colspan="4">1、执行手工导入必须确认手工导入过程不会与自动导入过程时间冲突。</td>
                    </tr>
                    <tr align="center" bgcolor="#C6D7EF">
                        <td align="left" colspan="4">2、如果不能确定时间是否冲突，请先停止定时器。手工导入完成后务必开启定时器。</td>
                    </tr>
                    <tr bgcolor="#C6D7EF" align="left">
                        <td align="left" colspan="4">请选择需要启动的数据导入服务：</td>
                    </tr>
                    <tr bgcolor="#C6D7EF">
                        <td align=left colspan="4">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type=radio checked name=dataType value=ocr id="ocr" onclick="changeLable(this.value);">
                            流水合成
                        </td>
                    </tr>
                    <tr bgcolor="#C6D7EF">
                        <td align=left colspan="4">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type=radio name=dataType value=imp id="imp" onclick="changeLable(this.value);">
                            监控预警
                        </td>
                    </tr>
                    <tr bgcolor="#C6D7EF">
                        <td align=left colspan="4">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type=radio name=dataType value=bms id="bms" onclick="changeLable(this.value);">
                            箱包返传
                        </td>
                    </tr>
                    <tr bgcolor="#D4D4D4" align="center">
                        <td align="center" colspan="4">请输入手工导入数据日期</td>
                    </tr>
                    <tr bgcolor="#FFFFFF" align="center">
                        <td align="right" width="45%">
                            <label id="dateLable">交易日期：</label>
                        </td>
                        <td align="left" height="20" width="150">
                            <input class="time-input" type="text"  name="dateDate" id="dateDate">
                        </td>
                        <td align="left" colspan="2">
                        </td>
                    </tr>
                </table>
            <input type="hidden" name="msgType" value="continue" class="form-control">
        </div>
    </div>
    <div class="form-group">
        <div class="col-md-12">
            <button type="button" class="btn btn-sm btn-primary" onclick="submithandImport()"><i class="fa fa-check"></i>确定</button>&nbsp;
        </div>
    </div>
</form>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        function submithandImport () {
            if ($('#dateDate').val()==''||$('#dateDate').val()==null||$('#dateDate').val()=="null") {
                $.modal.alert("请输入交易日期！");
            }else{
                $.modal.confirm("确定手工导入数据?", function() {
                    $.operate.post(ctx + "data/handImport/import", $('#form-handImport').serialize(),function (action) {
                        $.modal.alert(action.msg);
                        setTimeout(function() {
                            $.modal.openTab("数据处理实时反馈", ctx + "data/feedback");
                        },2000);
                    });
                })
            }
        }
        function changeLable(obj){
            if(obj == "bms"){
                document.getElementById("dateLable").innerText = "入箱日期：";
            }else{
                document.getElementById("dateLable").innerText = "交易日期：";
            }
        }
    </script>
</body>
</html>